/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.uniquindio.software.medisys.entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "rips")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Rips.findAll", query = "SELECT r FROM Rips r"),
    @NamedQuery(name = "Rips.findByIdRips", query = "SELECT r FROM Rips r WHERE r.idRips = :idRips"),
    @NamedQuery(name = "Rips.findByNumAutorizacion", query = "SELECT r FROM Rips r WHERE r.numAutorizacion = :numAutorizacion"),
    @NamedQuery(name = "Rips.findByCodProcedimiento", query = "SELECT r FROM Rips r WHERE r.codProcedimiento = :codProcedimiento"),
    @NamedQuery(name = "Rips.findByValor", query = "SELECT r FROM Rips r WHERE r.valor = :valor")})
public class Rips implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idRips")
    private Integer idRips;
    @Basic(optional = false)
    @Column(name = "numAutorizacion")
    private int numAutorizacion;
    @Basic(optional = false)
    @Column(name = "codProcedimiento")
    private int codProcedimiento;
    @Basic(optional = false)
    @Column(name = "valor")
    private int valor;
    @JoinColumn(name = "diagnostico_FK", referencedColumnName = "idDiagnostico")
    @ManyToOne(optional = false)
    private Diagnostico diagnosticoFK;
    @JoinColumn(name = "paciente", referencedColumnName = "idPaciente")
    @ManyToOne(optional = false)
    private Paciente paciente;
    @JoinColumn(name = "EPS_idEPS", referencedColumnName = "idEPS")
    @ManyToOne(optional = false)
    private Eps ePSidEPS;

    public Rips() {
    }

    public Rips(Integer idRips) {
        this.idRips = idRips;
    }

    public Rips(Integer idRips, int numAutorizacion, int codProcedimiento, int valor) {
        this.idRips = idRips;
        this.numAutorizacion = numAutorizacion;
        this.codProcedimiento = codProcedimiento;
        this.valor = valor;
    }

    public Integer getIdRips() {
        return idRips;
    }

    public void setIdRips(Integer idRips) {
        this.idRips = idRips;
    }

    public int getNumAutorizacion() {
        return numAutorizacion;
    }

    public void setNumAutorizacion(int numAutorizacion) {
        this.numAutorizacion = numAutorizacion;
    }

    public int getCodProcedimiento() {
        return codProcedimiento;
    }

    public void setCodProcedimiento(int codProcedimiento) {
        this.codProcedimiento = codProcedimiento;
    }

    public int getValor() {
        return valor;
    }

    public void setValor(int valor) {
        this.valor = valor;
    }

    public Diagnostico getDiagnosticoFK() {
        return diagnosticoFK;
    }

    public void setDiagnosticoFK(Diagnostico diagnosticoFK) {
        this.diagnosticoFK = diagnosticoFK;
    }

    public Paciente getPaciente() {
        return paciente;
    }

    public void setPaciente(Paciente paciente) {
        this.paciente = paciente;
    }

    public Eps getEPSidEPS() {
        return ePSidEPS;
    }

    public void setEPSidEPS(Eps ePSidEPS) {
        this.ePSidEPS = ePSidEPS;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRips != null ? idRips.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Rips)) {
            return false;
        }
        Rips other = (Rips) object;
        if ((this.idRips == null && other.idRips != null) || (this.idRips != null && !this.idRips.equals(other.idRips))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.Rips[ idRips=" + idRips + " ]";
    }
    
}
